.org 0xE6AE4 ; Stealth Firepower

Stealth_Firepower:

	PUSH 	{R4, LR}
	
	MOV 	R4, 0								; Stealth firepower bonus = 0
		
	CMP 	R1, 0								; Is unit in Hide/Dive mode?
	BEQ 	Unit_Not_In_Stealth					; Branch if unit is not in Hide/Dive mode
	
;-------------------------------------------------------------------------------
	
	PUSH 	{R0-R1}								; Player # and Partner #
	
	BL		Skill_Setup_Type_Common
	
	MOV 	R1, Rank_Backstab					; Rank: Backstab

	BL 		Check_Skills_Equipped				; Check the Skill is equipped	
	CMP 	R0, 0								; Does CO use that skill?
	ADDNE 	R4, R4, Stats_Backstab				; If CO use skill, add firepower

;-------------------------------------------------------------------------------
	
	POP 	{R0-R1}								; Player # and Partner #
	
Unit_Not_In_Stealth:

	MOV 	R0, R4								; Total stealth firepower bonus
	
	POP 	{R4, LR}	
	BX 		LR
	
;-------------------------------------------------------------------------------	

	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP
	NOP

;-------------------------------------------------------------------------------		

Stealth_Firepower_1:
	.dw Reg1_Skill
	
Stealth_Firepower_2:
	.dw Reg2_Skill



